package com.mobile.mapper;

import com.mobile.pojo.CheckItem;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author Encounter
 * @date 2024/10/02 17:10<br/>
 */
@Mapper
public interface CheckItemMapper
    {
        /**
         * 新增检查项
         *
         * @param checkItem 检查项
         * @return int 新增条数
         */
        @Insert("insert into t_checkitem(code, name, sex, age, price, type, attention, remark) " +
                "values (#{code} ,#{name} ,#{sex} ,#{age} ,#{price} ,#{type} ,#{attention} ,#{remark})")
        int add(CheckItem checkItem);
        
        /**
         * 根据id查询
         *
         * @param id 检查项id
         * @return {@link CheckItem }
         */
        @Select("select id, code, name, sex, age, price, type, attention, remark from t_checkitem where id = #{id}")
        CheckItem queryById(Integer id);
    }
